package lecture02.test;

import java.util.Scanner;

public class GradeWithSwitch {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入学生成绩（0-100）：");
        int score = sc.nextInt();
        int range = score / 10;
        String grade = switch (range) {
            case 10, 9 -> "A";
            case 8 -> "B";
            case 7, 6 -> "C";
            default -> "D";
        };
        System.out.println(grade);
    }
}
